<include file="Common:layout" />
<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>主题设置</h3>
            </div>
        </div>
        <div id="explanation" class="explanation">
            <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
                <h4 title="提示相关设置操作时应注意的要点">
                    操作提示 - 如果需要自己添加新的主题模板，请先将项目的./Appliacatin/Home/View下的Default目录拷贝到同级目录，并且重命名。<br/>
                    每个主题目录下的Static/css/xxx/theme.png为主题的图片标示，作为后台的主题模板列表的图片，请更换为自己的图片，图片名称还是theme.png。<br/>
                    如果不按照此规范操作，则没法读取到新的主题
                </h4>
                <span title="收起提示" id="explanationZoom"></span>
            </div>
            <ul>
                <li></li>
            </ul>
        </div>
    </div>

    <!-- 主题列表-->
    <div class="ncap-form-default tab_div_2" style="margin-top: 50px;">
        <dl class="row">
            <div class="tab-pane" id="tab_goods_images">
                <table>
                    <foreach name="css" item="vo" >
                        <tr>
                            <td data-id="{$key}" class="begin" width="100">
                                {$key}
                                <if condition="C('NOW_THEME') eq $key">
                                    <a href="javascript:void(0)" style="color: red;">使用中</a>
                                </if>
                            </td>

                            <if condition="C('NOW_THEME') eq $key">
                              <foreach name="vo" item="vv" >
                                  <td>
                                      <php>$css_arr = explode('/', C('css'));$now_css = C('NOW_THEME').'/'.$css_arr[1];</php>
                                      <if condition="$now_css eq $vv">
                                        <span style="background-color: #eee;">{$vv}</span>
                                      <else/>
                                        <span class="css">{$vv}</span>
                                      </if>
                                        <php>$vv_arr = explode('/', $vv);</php>
                                        <img src="./Application/Home/View/{$vv_arr[0]}/Static/css/{$vv_arr[1]}/{$vv_arr[1]}.png" width="100" height="100">
                                  </td>
                              </foreach>

                            <else />
                                <foreach name="vo" item="v" >
                                    <td>
                                        <span class="css">{$v}</span>
                                        <php>$v_arr = explode('/', $v);</php>
                                        <img src="./Application/Home/View/{$v_arr[0]}/Static/css/{$v_arr[1]}/{$v_arr[1]}.png" width="100" height="100">
                                    </td>
                                </foreach>
                            </if>
                        </tr>
                    </foreach>
                </table>
            </div>
        </dl>
    </div>
</div>
<div id="goTop"> <a href="JavaScript:void(0);" id="btntop"><i class="fa fa-angle-up"></i></a><a href="JavaScript:void(0);" id="btnbottom"><i class="fa fa-angle-down"></i></a></div>
<style>
    span {
        width:100px;
        text-align: center;
        border: 1px solid #ccc;
        cursor: pointer;
        font-size: 14px;
        border-radius: 10%;
        display: block;
        margin-bottom: 5px;
    }
    td {
        margin: 0 auto;
    }

</style>
<script type="text/javascript">
    //点击修改主题
    $(function() {
        $('.css').click(function() {
          var css = $(this).text();
          var template = $(this).parent().parent().find('.begin').attr('data-id');

          $.ajax({
            url:"{:U('System/theme')}",
            type: 'post',
            data: {
                css: css,
                template: template
            },
            success: function(msg) {
                window.location.reload();
            }
          });

        });
    });
</script>
</body>
</html>